<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
  </div>
</template>

<script>
import { getUser,getBooks } from "api/api";
export default {
  name: "HelloWorld",
  created() {
    this._getUser();
    this._getBooks();
  },
  data() {
    return {
      msg: "Welcome to Your Vue.js App"
    };
  },
  methods: {
    _getUser() {
      // console.log(getUser,getUser())
      getUser().then(res => {
        console.log("前端接盘数据", res);
      });
    },
    _getBooks() {
      console.log('fff')
      getBooks().then(res=>{
        console.log('获取书籍数据',res)
      })
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1,
h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
